﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>文档保存前和保存后执行的事件</title>
</head>
<body style="overflow:hidden">
    <script type="text/javascript">

        function Save() {
            //在这里写您保存前的代码
            alert("文件要开始保存了.....");
            var saveUrl = "/BeforeAndAfterSave/SaveDoc";
            pageofficectrl.SaveFilePage = saveUrl;
            pageofficectrl.WebSave();
            //在这里写您保存后的代码，比如判断保存结果pageofficectrl.CustomSaveResult
            if ("ok" == pageofficectrl.CustomSaveResult) {
                alert("文件已经保存成功了");
            } else {
                alert("保存失败！");
            }

        function OnPageOfficeCtrlInit() {
            pageofficectrl.AddCustomToolButton("保存", "Save", 1);
        }
    </script>
    <form id="form1">
        <div style=" width:auto; height:900px;">
            @Html.Raw(ViewBag.poCtrl)
        </div>
    </form>
</body>
</html>
